function [C, B, A] = tf2par(b, a)
    % 将传递函数从直接形式转换为并联形式
    n = length(a) - 1;
    C = zeros(1, n);
    B = zeros(n, n);
    A = zeros(n, n);
    for i = 1:n
        [r, p, k] = residue(b, a);
        C(i) = k;
        B(i, :) = r';
        A(i, :) = poly(p)';
        b = conv(b, [1 -p(i)]);
        a = conv(a, [1 -p(i)]);
    end
end